<template>
	<view class="main">
		<view :style="'padding-top:'+(demo.height+demo.top+10)+'px'">
			<head1 class="nav_top"
				:style="'height:' +  demo.height + 'px;' + 'padding-top:' + demo.top + 'px;padding-bottom:10px'"
				:nav="title">
			</head1>
		</view>
		<view class="talent_main">
			<view class="talent_main_top">
				<view class="tmt_left">
					<view class="img">
						<image :src="webImgUrl+dataList.photo" mode=""></image>
					</view>
					<view class="right">
						<view class="name">{{$praseStrEmpty(dataList.personName)}}</view>
						<view class="zs" v-if="dataList.certs!=''">所持证书：<text>{{$praseStrEmpty(dataList.certs)}}</text></view>
						<view class="zs" v-if="dataList.certs==''">所持证书：<text>暂无</text></view>
					</view>
				</view>
				<!-- <div class="tmt_right">
					<image src="../../static/icon/xx.png" mode=""></image>
				</div> -->
			</view>
			<view class="talent_main_bottom" >
				<view class="talent_form">
					<view class="talent_form_top">
						<view class="tit">基本信息</view>
						<view class="list">
							<view>
								<text>性别：</text>
								<text>{{$praseStrEmpty(dataList.sexName)}}</text>
							</view>
							<view>
								<text>年龄：</text>
								<text>{{$praseStrEmpty(dataList.age)}}</text>
							</view>
						</view>
						<view class="list">
							<view>
								<text>学历：</text>
								<text>{{$praseStrEmpty(dataList.educationName)}}</text>
							</view>
							
						</view>
						<view class="list">
							<view style="width: 100%;">
								<text>参与工作时间：</text>
								<text style="display: flex;align-items: center;">{{$praseStrEmpty(dataList.background)}}</text>
							</view>
						</view>
					</view>
					<view class="talent_form_top talent_form_bottom">
						<view class="tit">求职意向</view>
						<view class="list">
							<text>持有证书：</text>
							<text>{{$praseStrEmpty(dataList.certs)}}</text>
						</view>
						<view class="list">
							<text>工作性质：</text>
							<text>{{$praseStrEmpty(dataList.typeName)}}</text>
						</view>
						<view class="list">
							<text>期望薪资：</text>
							<text>{{$praseStrEmpty(dataList.salaryName)}}</text>
						</view>

						<view class="list">
							<text>联系电话：</text>
							<text>139****4569</text>
						</view>
					</view>
					<view class="talent_form_btn">
						<view class="get" @click="getPhone">
							获取联系方式
						</view>
						<view class="not" @click="personLook">
							<text>查看简历</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import head1 from '../../common/head/head.vue'
	export default {
		components: {
			head1
		},
		data() {
			return {
				title: '人才详情',
				webImgUrl: '',
				sc_imgurl: '../../static/icon/shoucang.png',
				demo: {
					top: '',
					height: ''
				},
				userId:'',
				follow: '', //是否关注
				dataList:{},
				getPhoneInfo:{
					userId:'',
					target:'findjb',
					targetId:''
				}
			}
		},
		onLoad(option) {
			this.follow = option.follow
			this.getPhoneInfo.targetId=option.id
			// this.recruitId = option.id //详情id
			this.recruitJob(option.id)
		},
		created() {
			this.webImgUrl = this.$webUrl
			const demo = uni.getMenuButtonBoundingClientRect()
			this.demo.top = demo.top
			this.demo.height = demo.height
		},
		methods: {
			// 强制刷新、重新加载页面
			test(){
				this.$forceUpdate()
				
			},
		recruitJob(dataId){
			this.$myResquest.recruitJobDetail({
				recruitId:dataId
			}).then(res=>{
				if(res.data.code==200){
					this.dataList=res.data.data
					this.userId=this.dataList.userId
					this.getPhoneInfo.userId=this.dataList.userId
				}
			})
		},
		personLook(){
			uni.navigateTo({
				url:'../../pageA/personResumeLook/personResumeLook?id='+this.userId
			})
		},
		getPhone(){
			// 获取提示信息字典
			let tishiData=this.$store.state.tishiInfo.data.ratDet
			this.$myResquest.recruitConcat(this.getPhoneInfo).then(res=>{
			
				if(res.data.code==200){
					uni.showModal({
						title: '温馨提示',
						showCancel: false,
						content: tishiData,
						success(res) {
							if (res.confirm) {} else if (res.cancel) {}
						}
					})
				}else{
					// uni.showToast({
					// 	title: res.data.msg,
					// 	icon: 'none'
					// })
				}
			})
		}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		position: fixed;
		top: 0;
		z-index: 999;
		height: 100%;
		width: 100%;
		background: #ffffff;
	}

	.talent_main {
		position: relative;
		.talent_main_top {
			width: 100%;
			height: 380rpx;
			background: url(../../static/icon/talentbg.png) no-repeat;
			background-size: cover;
			display: flex;
			justify-content: space-between;
			padding: 56rpx 40rpx 0;
			box-sizing: border-box;


			.tmt_left {
				height: 84rpx;
				display: flex;
				align-items: center;

				.img {
					width: 84rpx;
					height: 84rpx;
					background-color: #ffffff;
					border-radius: 50%;
					display: flex;
					justify-content: center;
					align-items: center;

					image {
						width: 80rpx;
						height: 80rpx;
						border-radius: 50%;
					}
				}

				.right {
					margin-left: 18rpx;

					.name {
						font-size: 36rpx;
						font-family: Adobe Heiti Std, Adobe Heiti Std-R;
						text-align: left;
						color: #333333;
						height: 58rpx;
					}

					.zs {

						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						text-align: left;
						color: #333333;
					}
				}
			}

			.tmt_right {
				width: 36rpx;
				height: 36rpx;
				padding-top: 22rpx;
				box-sizing: content-box;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		.talent_main_bottom {
			position: absolute;
			width: 664rpx;
			top: 170rpx;
			left: 50%;
			margin-left: -332rpx;
			border-radius: 10rpx;

			.talent_form {

				height: 764rpx;
				width: 764rpx;

				.talent_form_top {
					padding: 30rpx 40rpx;
					width: 664rpx;
					background: #ffffff;
					border-radius: 10rpx;
					box-shadow: 0px 0px 18rpx 0px rgba(0, 0, 0, 0.1);

					.tit {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						text-align: left;
						color: #333333;
						margin-bottom: 20rpx;
					}

					.list {
						display: flex;
						justify-content: space-between;
						margin-bottom: 20rpx;

						:first-child {
							color: #999999;
						}

						view {
							width: 50%;
							display: flex;
							justify-content: flex-start;

							:first-child {
								color: #999999;
							}
						}
					}
				}

				.talent_form_bottom {
					margin-top: 20rpx;
					box-shadow: 0px 0px 18rpx 0px rgba(0, 0, 0, 0.1);
				}

				.talent_form_btn {
					display: flex;
					justify-content: center;
					flex-direction: column;
					align-items: center;
					margin-top: 30rpx;
					font-size: 28rpx;
					width: 664rpx;

					.get {
						width: 600rpx;
						height: 88rpx;
						line-height: 88rpx;
						background: #5cd1ce;
						border-radius: 44rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						text-align: center;
						color: #ffffff;
					}

					.not {
						margin-top: 26rpx;
						width: 600rpx;
						height: 88rpx;
						line-height: 88rpx;
						background: #f9f9f9;
						border-radius: 44rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						text-align: center;
						color: #999999;
					}
				}
			}
		}
	}
</style>
